# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: György Balló <ballogy@freestart.hu>

pkgname=gupnp
pkgver=1.0.2
pkgrel=1
pkgdesc="An object-oriented UPNP framework"
arch=(i686 x86_64)
url="http://gupnp.org/"
license=(LGPL)
depends=(gssdp util-linux)
makedepends=(gobject-introspection gtk-doc vala autoconf-archive git) 
optdepends=('python2: gupnp-binding-tool')
_commit=3ffd35b20066b70be86e1e55f1ac8e0b267a2009  # tags/gupnp-1.0.2^0
source=("git+https://git.gnome.org/browse/gupnp#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^gupnp-//;s/-/+/g'
}

prepare() {
  cd $pkgname
  sed -i '1s|^#!.*python$|&2|' tools/gupnp-binding-tool
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  export CPPFLAGS="$CPPFLAGS -O"
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
              --disable-static --with-context-manager=linux --enable-gtk-doc --disable-debug
  make V=1
}

check() {
  cd $pkgname
  make check
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
